<script setup lang="ts">
import {ref} from "vue";
import useUserStore from '@/store/modules/user.ts'
const userStore = useUserStore()
</script>

<template>
  <div class="left-1-1">
    <img :src="userStore.userInfo.avatar ? userStore.userInfo.avatar : '/src/assets/avatar.jpg'" alt="" class="avatar">
    <div class="info">
      <div class="name">{{ userStore.userInfo.nickname ? userStore.userInfo.nickname : userStore.userInfo.username}}</div>
      <div class="title">{{userStore.userInfo.position}}</div>
    </div>
  </div>
  <hr>
  <div class="left-1-2">
    <div class="attention">
      <div class="number">{{ userStore.userInfo.totalAttentionNum ? userStore.userInfo.totalAttentionNum : 0}}</div>
      <div>关注</div>
    </div>
    <div class="fan">
      <div class="number">{{ userStore.userInfo.totalFanNum ? userStore.userInfo.totalFanNum : 0}}</div>
      <div>粉丝</div>
    </div>
    <div class="article">
      <div class="number">{{ userStore.userInfo.totalArticleNum ? userStore.userInfo.totalArticleNum : 0 }}</div>
      <div>文章</div>
    </div>
  </div>
</template>
<style scoped lang="scss">
.left-1-1{
  height: 50%;
  display: flex;
  padding-bottom: 20px;
  .avatar{
    border-radius: 50%;
    height: 50px;
    aspect-ratio: 1/1;
    margin-right: 10px;
  }
  .name{
    overflow : hidden;
    text-overflow: ellipsis;//当对象内文本溢出时显示省略标记
    display: -webkit-box;
    -webkit-line-clamp:1;//这边的2指的是两行
    -webkit-box-orient: vertical;
  }
  .title{
    color: rgb(169, 172, 181);
  }
}
.left-1-2{
  display: flex;
  padding-top: 20px;
  justify-content: space-between;
  .number{
    color: rgb(3, 0, 26);
    font-size: 17px;
  }
  :nth-child(2):nth-child(2){
    color: rgb(131, 134, 162);
  }
}
hr{
  background-color: rgb(229, 231, 235);
}
</style>
